<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" id="text">
    <button>提交</button>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
    <script>
        const btn = $('button')[0];
        btn.onclick = function() {
            const imgs = $('#text')[0].value;
            console.log(imgs.value)
            $.ajax({
                url: "/api/image",
                method: 'post',
                data: {
                    src: imgs
                },
                success: res => {
                    console.log(res)
                },
                error: res => {
                    console.log(res);
                }
            })
        }
        
    </script>
</body>

</html>